using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint.WebControls;
using ARF.Web.Interfaces;
using System.Xml.XPath;
using System.Web.UI;

namespace ARF.Web.Fields
{
    public class BaseField : BaseFieldControl, IXmlProvider
    {
        #region IXmlProvider Members

        public IXPathNavigable XmlAsObject
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }
            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public string XmlAsString
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }
            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        #endregion

        protected virtual ToolBar AddToolbar(Control owner)
        {
            ToolBar oBar = (ToolBar)Page.LoadControl("~/_controltemplates/ToolBar.ascx");
            oBar.ID = "spToolbar";
            owner.Controls.Add(oBar);
            return oBar;
        }

        protected virtual ToolBarButton AddToolbarButton(ToolBar owner, string title, string buttonID)
        {
            ToolBarButton oButton = Page.LoadControl("~/_controltemplates/ToolBarButton.ascx") as ToolBarButton;
            owner.Buttons.Controls.Add(oButton);
            oButton.Text = title;
            oButton.ID = buttonID;
            oButton.OnClientClick = "g_bWarnBeforeLeave = false";
            return oButton;
        }
    }
}
